ssh root@10.8.1.200
nohup /usr/dt/bin/dtterm -name `hostname` -display 10.8.1.213:0.0 &
su - oracle
nohup /usr/dt/bin/dtterm -name oracle@`hostname` -display 10.8.1.213:0.0 &

# following installation steps have been integrated into cds_deploy.sh under
# EGTC local deployment
# ===================================================================================
# Host : 10.8.1.200
# Workspace : /cds/workspace/release/..
# Source Code Repository : modules/internal/perftest/src/scripts/cdsa_wrapper_scripts
# ===================================================================================
#
# 10.8.1.200:/cds/workspace/release/module/internal/perftest/src/scripts/cdsa_wrapper_scripts/
#
# The cds_deploy.sh have been changed name to cdsetup.sh
--------------------------------------------------------------------------------
# Deploy CDS on MLK lab

CDS_HOME=/benchmark/phoenix/b15/; export CDS_HOME
JAVA_HOME=/usr/java; export JAVA_HOME
PATH=.:${CDS_HOME}/bin:${JAVA_HOME}/bin:${PATH}; export PATH
cd $CDS_HOME

ORACLE_SID=CDSTWO1; export ORACLE_SID
ORACLE_SID=CDSTHREE1; export ORACLE_SID
PREFIX=jewel4; export PREFIX

config() {
    echo configing $1
    FN=`basename $1`
    cat $1 | sed "$2" > /tmp/$FN
    cp /tmp/$FN $1
}

config $CDS_HOME/bin/init_env.sh "
s/\(BEA_HOME=\).*/\1\/opt/
s/\(WL_HOME=\).*/\1\/opt/
s/\(SUN_AS_HOME=\).*/\1\/opt\/glassfish_v2_1/
s/\(JAVA_HOME=\).*/\1\/usr\/jdk\/jdk1.6.0_12/
"

# save the DBConf.xml
cp $CDS_HOME/cfg/DBConf.xml $CDS_HOME/cfg/DBConf.xml.sav

# following command is unsed on jewel2. since of to much chnages
config $CDS_HOME/cfg/DBConf.xml "
s/<Hostname>.*<\/Hostname>/<Hostname>10.60.11.22<\/Hostname>/
s/<SID>.*<\/SID>/<SID>$ORACLE_SID<\/SID>/
s/<Prefix>.*<\/Prefix>/<Prefix>jewel4<\/Prefix>/
s/<Password>.*<\/Password>/<Password>cdsperf<\/Password>/
"

#
# since of too much changes, it should be better to copy the whole file
#
cat > $CDS_HOME/cfg/DBConf.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>

<CDSDatabase>
<DBServer name="DBServer1">
    <Hostname>10.60.11.22</Hostname>
    <Port>1521</Port>
    <SID>$ORACLE_SID</SID>
    <Tablespace>CDSII</Tablespace>
    <Tablespace name="catalog">CDS_CATALOGII</Tablespace>
    <Tablespace name="catalog indexes">CDSIXII</Tablespace>
    <Tablespace name="content">CDS_CONTENTII</Tablespace>
    <Tablespace name="content indexes">CDSIXII</Tablespace>
    <Tablespace name="event">CDS_EVENTII</Tablespace>
    <Tablespace name="event indexes">CDSIXII</Tablespace>
    <Tablespace name="subscriber">CDS_SUBSCRIBERII</Tablespace>
    <Tablespace name="subscriber indexes">CDSIXII</Tablespace>
    <Tablespace name="vending">CDS_VENDINGII</Tablespace>
    <Tablespace name="vending indexes">CDSIXII</Tablespace>
    <TempTablespace>TEMP</TempTablespace>
</DBServer>


    <Catalog>
        <Prefix>PRFII</Prefix>
        <Password>cdsperf</Password>
        <DBServer>DBServer1</DBServer>
    </Catalog>


    <Vending name="cds.vending.server.1">
        <Prefix>PRFII</Prefix>
        <Password>cdsperf</Password>
        <DBServer>DBServer1</DBServer>
    </Vending>
</CDSDatabase>
EOF

config $CDS_HOME/cfg/DBSysUser.xml "
s/<Password>.*<\/Password>/<Password>oracle<\/Password>/
"

export HOSTNAME=`hostname`
export PORT_NO=4080

config $CDS_HOME/cfg/sn_sample.cfg "
s/server.type=.*/server.type=sun/
s/app.server.portnumber=.*/app.server.portnumber=$PORT_NO/
s/app.server.ssl.port=.*/app.server.ssl.port=`expr $PORT_NO + 1`/
s/uri=http:\/\/webhost.domain.com:80/uri=http:\/\/$HOSTNAME:$PORT_NO/
"

cdsi deploy     # should delete the $CDS_HOME/deployment/cds if it is already there
cd $CDS_HOME/deployment/cds/sun/applications/
deploymq.sh server
broker.sh start
deploy.sh create

[root@jewel2]/benchmark/phoenix/b14/deployment/cds/sun/applications# deploy.sh create
Enter the CDS Domain's Admin Name [cdsadmin]:
Enter the CDS Domain's Admin Password [cdsadmin]:
Enter the CDS Domain's Master Password [cdsmaster]:
Enter the CDS Domain's Admin Server Port [4848]:
Enter the number of remote MQ running [1]:
Enter the Host Name for MQ server:1 [localhost]:
Enter the Port Number for MQ server:1 [7676]:


bash-3.00# cat /cds/workspace/release/Sun_Java_System_Content_Delivery_Server_5.1_ga/deployment/cds/sun/applications/brokervars.sh
#!/bin/bash

BROKER_HOST=localhost
BROKER_PORT=7676
BROKER_NAME=cdsbroker
ADMIN_NAME=admin
USER_NAME=guest
USER_PSWD=guest
IMQ_BIN=/cds/glassfish/imq/bin
IMQ_LIB=/cds/glassfish/imq/lib
IMQ_LICENSE=unl

# after right configured the brokervars.sh. Running follow command to deploymq automatically
# echo | deploymq.sh server

cdse startserver
# admin.sh start

grep  11\.22 /etc/hosts
rsh db2
================================================================================

# setup Sun AppServer
/sol9/sjsas_pe-9_0_01-p01-solaris-sparc.bin
SUN_AS_HOME=/sol9/sjscds-ea/deployment/SUNWappserver

CDS_HOME=/sol9/sjscds-ea; export CDS_HOME
JAVA_HOME=/usr/jdk/jdk1.6.0_10; export JAVA_HOME
PATH=.:${CDS_HOME}/bin:${JAVA_HOME}/bin:${PATH}; export PATH

cat > $CDS_HOME/bin/init_env.sh <<EOF
export BEA_HOME=/pkgs/weblogic921
export WL_HOME=/pkgs/weblogic921/weblogic92
export SUN_AS_HOME=/sol9/SUNWappserver

export JAVA_HOME=/usr/jdk/jdk1.6.0_10
export DEFAULT_DEPL=cds
export DEFAULT_CONFIG=sn_sample.cfg
export DEFAULT_DB=DBConf.xml
export DEFAULT_SYS_USER=DBSysUser.xml
EOF

cat > $CDS_HOME/cfg/DBConf.xml <<EOF
<CDSDatabase>

    <DBServer name="DBServer1">
        <Hostname>localhost</Hostname>
        <Port>1521</Port>
        <SID>ORCL</SID>
        <Tablespace>USERS</Tablespace>
        <Tablespace name="catalog">USERS</Tablespace>
        <Tablespace name="catalog indexes">USERS</Tablespace>
        <Tablespace name="content">USERS</Tablespace>
        <Tablespace name="content indexes">USERS</Tablespace>
        <Tablespace name="event">USERS</Tablespace>
        <Tablespace name="event indexes">USERS</Tablespace>
        <Tablespace name="subscriber">USERS</Tablespace>
        <Tablespace name="subscriber indexes">USERS</Tablespace>
        <Tablespace name="vending">USERS</Tablespace>
        <Tablespace name="vending indexes">USERS</Tablespace>
        <TempTablespace>TEMP</TempTablespace>
    </DBServer>

    <Catalog>
        <Prefix>CDS</Prefix>
        <Password>q1w2e3</Password>
        <DBServer>DBServer1</DBServer>
    </Catalog>

    <Vending name="cds.vending.server.1">
        <Prefix>CDS</Prefix>
        <Password>q1w2e3</Password>
        <DBServer>DBServer1</DBServer>
    </Vending>

    <!--
    <DBServer name="DBServer2">
        <Hostname>dbhost2.domain.com</Hostname>
        <Port>1521</Port>
        <SID>dbsid2</SID>
        <Tablespace>USERS</Tablespace>
        <Tablespace name="catalog">USERS</Tablespace>
        <Tablespace name="catalog indexes">USERS</Tablespace>
        <Tablespace name="content">USERS</Tablespace>
        <Tablespace name="content indexes">USERS</Tablespace>
        <Tablespace name="event">USERS</Tablespace>
        <Tablespace name="event indexes">USERS</Tablespace>
        <Tablespace name="subscriber">USERS</Tablespace>
        <Tablespace name="subscriber indexes">USERS</Tablespace>
        <Tablespace name="vending">USERS</Tablespace>
        <Tablespace name="vending indexes">USERS</Tablespace>
        <TempTablespace>TEMP</TempTablespace>
    </DBServer>

    <Vending name="cds.vending.server.2">
        <Prefix>CDS2</Prefix>
        <Password>dbpassword2</Password>
        <DBServer>DBServer2</DBServer>
    </Vending>
    -->

</CDSDatabase>
EOF

cat >$CDS_HOME/cfg/DBSysUser.xml <<EOF
<DBUsers>

    <DBServer name="DBServer1">
        <User>system</User>
        <Password>q1w2e3</Password>
    </DBServer>

    <!--
    <DBServer name="DBServer2">
        <User>system2</User>
        <Password>dbsyspassword2</Password>
    </DBServer>
    -->

</DBUsers>
EOF

export HOSTNAME=`hostname`
export PORT_NO=4080
cat >$CDS_HOME/cfg/sn_sample.cfg <<EOF
######################################################################
#
# Configuration File
#
# This Java properties file defines all of the required properties
# that are used to deploy and configure a server. Your deployment
# can consist of any combination of the following components:
#
# CATALOG MANAGER         (cs)
# DEVELOPER PORTAL        (dp)
# VENDING MANAGER         (vs)
# SUBSCRIBER PORTAL       (sp)
# FULFILLMENT MANAGER     (fs)
# EVENT SERVICE           (es)
# MESSAGING SERVICE       (ms)
# NOTIFY SERVICE          (ns)
# POSTPAID SERVICE        (pps)
# MONITORING SERVICE      (mos)
# CATALOG SEARCH SERVICE  (css)
# VENDING SEARCH SERVICE  (vss)
#
# NOTE: Be careful not to leave trailing spaces.....
#
######################################################################

#=====================================================================
# General Properties
#=====================================================================

# Specifies your application server to be Sun Java System (DO NOT CHANGE)
server.type=sun

# ------------ Java Settings ------------- #
java.mem=-Xms512m -Xmx1024m -XX:MaxPermSize=256m

# --------- App Server Settings ---------- #
app.server.domain=cdsdomain
app.server.name=cdsserver
app.server.portnumber=$PORT_NO
app.server.ssl.port=`expr $PORT_NO + 1`

# --------- JNDI Server Settings --------- #
# Specifies the JNDI factory (DO NOT CHANGE)
jndi.factory=com.sun.jndi.fscontext.RefFSContextFactory
# Specifies the JNDI URL (DO NOT CHANGE)
jndi.url=file://[[deployment]]/sun

# ------------- URI Settings ------------- #
cs.internal.uri=http://$HOSTNAME:$PORT_NO/admin/
dp.internal.uri=http://$HOSTNAME:$PORT_NO/developer/
fs.internal.uri=http://$HOSTNAME:$PORT_NO/fs/
vs.internal.uri=http://$HOSTNAME:$PORT_NO/vsadmin/
sp.internal.uri=http://$HOSTNAME:$PORT_NO/subscriber/
es.internal.uri=http://$HOSTNAME:$PORT_NO/es/
ms.internal.uri=http://$HOSTNAME:$PORT_NO/ms/
ns.internal.uri=http://$HOSTNAME:$PORT_NO/ns/
pps.internal.uri=http://$HOSTNAME:$PORT_NO/pps/
mos.internal.uri=http://$HOSTNAME:$PORT_NO/mos/
css.internal.uri=http://$HOSTNAME:$PORT_NO/css/
vss.internal.uri=http://$HOSTNAME:$PORT_NO/vss/

cs.external.uri=http://$HOSTNAME:$PORT_NO/admin/
dp.external.uri=http://$HOSTNAME:$PORT_NO/developer/
fs.external.uri=http://$HOSTNAME:$PORT_NO/fs/
vs.external.uri=http://$HOSTNAME:$PORT_NO/vsadmin/
sp.external.uri=http://$HOSTNAME:$PORT_NO/subscriber/

# ----------- Vending Settings ----------- #
vs.account.name=cds.vending.server.1
vs.account.password=vending

# ------------ Mail Settings ------------- #
ms.mail.smtp.host=localhost
ms.mail.smtp.sender=root@$HOSTNAME

#=====================================================================
# Included Managers, Portals, & Services
#=====================================================================
# Make any of the following lines a comment if the manager, portal, or service should not be deployed
cs.include
dp.include
vs.include
sp.include
fs.include
es.include
ms.include
ns.include
pps.include
mos.include
css.include
vss.include
EOF

# modify DBConf.xml, DBSysUser.xml
cp /sol11/u01/app/oracle/product/11.1.0/db_1/sqldeveloper/jdbc/lib/ojdbc14.jar $CDS_HOME/dist/cds/lib/external
cdsi db init

# modify cfg/sn_sample.cfg
cdsi deploy
cd $CDS_HOME/deployment/cds/sun/applications/
deploymq.sh server
broker.sh start
deploy.sh create fast
cdse startserver
# admin.sh start


